const qiniu = require('qiniu')


exports.getToken = (req, res) => {
    var accessKey = 'cqudK337xT8g3VyX3FZfxzXEhhe4qAnb0Gb3sOut';
    var secretKey = 'OVEXGArrs6WXLlcu-9HZDMHoxMUkWgNaFIWccr1l';
    var mac = new qiniu.auth.digest.Mac(accessKey, secretKey);

    var options = {
        scope: 'yyx-photo-system',
    };
    var putPolicy = new qiniu.rs.PutPolicy(options);
    var uploadToken = putPolicy.uploadToken(mac);
    // console.log(uploadToken);
    res.send({
        status: 0,
        qiniutoken: uploadToken
    })
}